#ifndef NORM_H
#define NORM_H

#include <iostream>
#include <vector>
#include <math.h>

using namespace std;

class Norm
{
public:
    double onenorm(vector<double> v)
    {
        double sum = 0;
        for (int i = 0; i < v.size(); i++)
        {
            sum += abs(v[i]);
        }
        return sum;
    }

    double twonorm(vector<double> v)
    {
        double sum = 0;
        for (int i = 0; i < v.size(); i++)
        {
            sum += pow(v[i], 2);
        }
        return sum;
    }

    double inftynorm(vector<double> v)
    {
        double m = 0;
        for (int i = 0; i < v.size(); i++)
        {
            if (m <= abs(v[i]))
                m = abs(v[i]);
        }
        return m;
    }

    double Inftynorm(vector<double> v)
    {
        double m = 0;
        for (int i = 0; i < 2; i++)
        {
            if (m <= abs(v[i]))
                m = abs(v[i]);
        }
        return m;
    }
};

#endif